/**
 * Created by Jie on 2017/2/5.
 */
var express = require('express');
var router = express.Router();

var data = require('../util/result');
var menu = require('../controller/core/menuController');

router.get('/',menu.index);
router.get('/get/:id',menu.one);
router.get('/del/:id',menu.del);
router.post('/opt/:id',function (req,res) {
    if(req.params.id==0){
        menu.insert(req,res);
    }else {
        menu.edit(req,res);
    }
});
router.get('/form/:id',menu.form);
router.post('/list',menu.list);

module.exports = router;